/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.agileClinic.controller;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import javax.ejb.EJBException;
import javax.persistence.PersistenceException;

/**
 * Classe do Projeto guardiao - Criado em 16/04/2013 - Controler generico para
 * servir de base para os outros controlers
 *
 * @author Gilmário
 */
public abstract class ControlerGenerico<T, PK extends Serializable> implements Serializable {

    /**
     *
     * @param t
     * @throws SQLException
     * @throws PersistenceException
     * @throws EJBException
     * @throws Exception
     */
    public abstract void salvarouAtualizar(T t) throws SQLException, PersistenceException, EJBException, Exception;

    /**
     *
     * @param t
     * @throws SQLException
     * @throws PersistenceException
     * @throws EJBException
     * @throws Exception
     */
    public abstract void deletar(T t) throws SQLException, PersistenceException, EJBException, Exception;

    /**
     *
     * @param id
     * @return
     * @throws SQLException
     * @throws PersistenceException
     * @throws EJBException
     * @throws Exception
     */
    public abstract T carregar(PK id) throws SQLException, PersistenceException, EJBException, Exception;

    /**
     *
     * @return @throws SQLException
     * @throws PersistenceException
     * @throws EJBException
     * @throws Exception
     */
    public abstract List<T> listarTodos() throws SQLException, PersistenceException, EJBException, Exception;
}
